import {request} from "@/api/request";
export function addCart(data){//添加购物车
  return request({
    url:`/api/carts`,
    method:'post',
    data
  })
}
export function modifyCart(id,data){//修改购物车
  return request({
    url:`/api/carts/${id}`,
    method:'put',
    data
  })
}
export function checkedCart(data){//选中商品的状态
  return request({
    url:`/api/carts/checked`,
    method:'patch',
    data
  })
}
export function getCart(data=''){//得到购物车
  return request({
    url:`/api/carts?`+data
  })
}
export function deleteCartItem(id){//删除购物车
  return request({
    url:`/api/carts/${id}`,
    method:'delete'
  })
}
